import Vue from 'vue'
// bas.css 样式的重制
import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
// 引入英文语言包
// import locale from 'element-ui/lib/locale/lang/en' // lang i18n
// .scss 文件 => .less文件
import '@/styles/index.scss' // global css

import App from './App'
import store from './store'
import router from './router'

import '@/icons' // icon
import '@/permission' // permission control

import '@/directives/index.js'
import Print from 'vue-print-nb'
Vue.use(Print)

import * as directives from './directives'
// 这个就不用了
// import PageTools from '@/components/PageTools'
// Vue.component('PageTools', PageTools)
// vue.use()这个方法
import components from '@/components'
Vue.use(components)
// 封装过滤器
// {{ time | formatTime}}
// 过滤器传参
// {{ time | formatTime('YYYY年MM月DD日')}}
import * as filters from '@/filters'
Object.keys(filters).forEach(item => {
  Vue.filter(item, filters[item])
})

// console.log(result)
// for in 遍历对象
// eslint-disable-next-line prefer-const
for (let key in directives) {
  Vue.directive(key, directives[key])
}
Object.keys(directives).forEach(item => {
  Vue.directive(item, directives[item])
})
// import request from '@/utils/request'

/**
 * If you don't want to use mock-server
 * you want to use MockJs for mock api
 * you can execute: mockXHR()
 *
 * Currently MockJs will be used in the production environment,
 * please remove it before going online ! ! !
 */

// set ElementUI lang to EN
// Vue.use(ElementUI, { locale })
// 如果想要中文版 element-ui，按如下方式声明
Vue.use(ElementUI)

// 因为我是是有后端接口，所以不需要模拟假数据
// main.js里面的代码
// mock文件夹
// vue.config.js 39行

Vue.config.productionTip = false

// Vue.directive('imgerror', imgerror)
// Vue.directive('color', color)

// 挂载vue的原型 => vue实例（组件）都可以访问原型上的方法 this.$request
// Vue.prototype.$request = request

new Vue({
  // el: '#app',
  router,
  store,
  render: h => h(App)
}).$mount('#app')
